package com.hondee.fuzzyquery.query;

import com.hondee.fuzzyquery.utils.StringUtil;

public abstract class AbstractQueryTarget implements IQueryTarget {

	protected String identity;
	protected String name;
	protected String description;
	protected Boolean isCache;
	protected Boolean isPaging;
	
	public AbstractQueryTarget(){}
	
	public AbstractQueryTarget(String identity, String name, String description) {
		this(identity,name,description,false,false);
	}

	public AbstractQueryTarget(String identity, String name, String description,Boolean isCache ,Boolean isPaging) {
		if(StringUtil.isNullOrEmpty(identity)||StringUtil.isNullOrEmpty(name) || isCache==null || isPaging==null){
			throw new RuntimeException("Query target parametor should not be null");
		}
		this.identity = identity;
		this.name = name;
		this.isCache = isCache;
		this.isPaging = isPaging;
		this.description = description;
	}

	@Override
	public String getName() {
		return name;
	}

	@Override
	public Boolean isCache() {
		return isCache;
	}
	
	@Override
	public Boolean isPaging(){
		return isPaging;
	}
	
	@Override
	public String getIdentity(){
		return identity;
	}
	
	@Override
	public String getDescription(){
		return description;
	}

}
